package nio.bytebuffer;

import java.nio.ByteBuffer;

public class Allocate_AllocateDirect {

    public static void main(String[] args) {
        ByteBuffer bytebuffer1 = ByteBuffer.allocateDirect( 100);
        ByteBuffer bytebuffer2 = ByteBuffer.allocate( 200);
        System.out.println(" bytebuffer1 position = " + bytebuffer1.position()
                + " limit = " + bytebuffer1.limit());
        System.out.println(" bytebuffer2 position = " + bytebuffer2.position()
                + " limit = " + bytebuffer2.limit());
        // java.nio.DirectByteBuffer[pos=0 lim=100 cap=100]
        System.out.println(" bytebuffer1 = " + bytebuffer1 + " isDirect = " + bytebuffer1. isDirect());
        // java.nio.HeapByteBuffer[pos=0 lim=200 cap=200]
        System.out.println(" bytebuffer2 = " + bytebuffer2 + " isDirect = " + bytebuffer2. isDirect());
    }

}
